'use strict';

const Subscription = require('egg').Subscription;

// 建行生活 每日提醒
class YzxJhshCache extends Subscription {
  static get schedule() {
    return {
      // interval: '5s',
      type: 'worker',
      cron: '0 0 12 * * *',
    };
  }
  async base_subscribe({ name, content }) {
    await this.service.mailer.send({
      emails: ['2428047022@qq.com'],
      subject: `定时提醒-${name}`,
      html: content,
    });
  }
  async subscribe() {
    await this.base_subscribe({
      name: '建行生活',
      content: '建行生活记得签到',
    });
  }
}

module.exports = YzxJhshCache;
